cmake_minimum_required(VERSION 2.6)

PROJECT(DPVS)

add_subdirectory(./3rd-party/dtrack_lib)

find_package(OpenGL)
find_package(Equalizer 1.0.0 REQUIRED)
find_package(PCL 1.4 REQUIRED)
##

include_directories(
					${PCL_INCLUDE_DIRS}
					${EQUALIZER_INCLUDE_DIRS}
					${CMAKE_SOURCE_DIR}/3rd-party/dtrack_lib 
					${EQUALIZER_INCLUDE_DIRS}/libs 
					./src/include
					./src/shaders)
					
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})

SET(PC_SRC
	./src/pointCloudDist.cpp
	./src/pointCloud.cpp	
)

SET(PC_HEADER
	./src/pointCloudDist.h
	./src/pointCloud.h	
)

SET(TRACKING_SRC
	./src/tracker.cpp
	./src/body.cpp	
)

SET(TRACKING_HEADER
	./src/tracker.h
	./src/body.h	
)

			
set(DPVS_SRC 
	./src/main.cpp 
	./src/channel.cpp
	./src/config.cpp
	./src/dpvs.cpp
	./src/frameData.cpp
	./src/initData.cpp
	./src/localInitData.cpp
	./src/node.cpp
	./src/pipe.cpp
	./src/window.cpp
	./src/tracker.cpp
	./src/renderState.cpp
	./src/error.cpp
	./src/configEvent.cpp
	./src/view.cpp
	${PC_SRC}
	${TRACKING_SRC}
)
	
set(DPVS_HEADER 

	./src/channel.h
	./src/config.h
	./src/dpvs.h
	./src/frameData.h
	./src/initData.h
	./src/localInitData.h
	./src/node.h
	./src/pipe.h
	./src/window.h
	./src/tracker.h
	./src/typedefs.h
	./src/renderState.h
	./src/error.h
	./src/configEvent.h
	./src/view.h
	./src/modelAsigner.h
	${PC_HEADER}
	${TRACKING_HEADER}
)	

SET(XYZ2PCD_SRC ./src/tools/xyz2pcd.cpp)
add_executable(XYZ2PCD ${XYZ2PCD_SRC})
target_link_libraries(XYZ2PCD 
					${PCL_LIBRARIES}
)


add_executable(DPVS ${DPVS_SRC} ${DPVS_HEADER})

target_link_libraries(DPVS 
					dtrack_lib 
					${EQUALIZER_LIBRARIES} 
					${OPENGL_LIBRARIES}
					${PCL_LIBRARIES}
)
source_group(Pointcloud FILES ${PC_HEADER} ${PC_SRC})
source_group(Tracking FILES ${TRACKING_HEADER} ${TRACKING_SRC})